/*
 *  This file is part of Social Media Monitoring Toolbox.
 *
 *  Social Media Monitoring Toolbox is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Social Media Monitoring Toolbox is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Social Media Monitoring Toolbox. If not, see <http://www.gnu.org/licenses/lgpl.html>.
 *
 * � Copyright 2013
 * Jana Asmussen, Julian Bau�, Daniela Dalock, Christian Gutjahr,
 * Fabian Heidorn, Alexander Kaack, Vitali Kagadij 
 * 
 */

package logic;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import types.*;


public interface ILogic {
	
	/**
	 * Returns a list of all StreamDescriptors the database knows. These
	 * StreamDescriptors can be used to to get all posts which are referenced by
	 * those.
	 * 
	 * @return List of all StreamDescriptors
	 */
	public List<StreamDescriptor> getAllStreamDescriptor();
	
	/**
	 * Returns a list of all StreamDescriptors of TweetPosts the database knows.
	 * These StreamDescriptors can be used to to get all posts which are
	 * referenced by those.
	 * 
	 * @return List of all StreamDescriptors for TweetPosts
	 */
	public List<StreamDescriptor> getAllTwitterStreamDescriptor();
	
	/**
	 * Returns a list of all StreamDescriptors of YoutubeVideoTypes the database
	 * knows. These StreamDescriptors can be used to to get all posts which are
	 * referenced by those.
	 * 
	 * @return List of all StreamDescriptors for YoutubeVideoTypes
	 */
	public List<StreamDescriptor> getAllYoutubeStreamDescriptor();
	
	
	/**
	 * Returns a List of all TweetPosts the database knows, for a specific
	 * StreamDescriptor.
	 * 
	 * @param streamDes StreamDescriptor the database knows
	 * @param filter FilterType to limit the result
	 * @return List of TweetPosts
	 */
	public List<TweetPost> getTweetPosts(StreamDescriptor streamDes, FilterTyp filter);
	
	/**
	 * Returns a List of all YoutubeVideoTypes the database knows, for a
	 * specific StreamDescriptor. The streamDes argument must be available in
	 * the database. The filter argument can limit the results.
	 * 
	 * @param streamDes StreamDescriptor the database knows
	 * @param filter FilterType to limit the result
	 * @return List of YoutubeVideoTypes
	 */
	public List<YoutubeVideoType> getYouTubeVideos(StreamDescriptor streamDes, FilterTyp filter);
	
	/*
	 * Returns a List of the TweetPost sorted by the number of retweets.
	 * 
	 * @return List of sorted TweetPost
	 
	public List<TweetPost> getTopTweetPosts();
	*/
	
	/**
	 * Returns a List of all twitter posts the database contains.
	 * 
	 * @param filter FilterTyp to limit the result
	 * @return List of TweetPost
	 */
	public List<TweetPost> getAllTweetPost();
	
	/**
	 * This method returns a list of YoutubeVideoTypes sorted by views
	 * 
	 * @return List of YoutubeVideoType
	 */
	public List<YoutubeVideoType> getTopYoutubePosts();
	
	/**
	 * This method updates all TweetPosts for a stated analysis. The analysis
	 * argument specifies the analysis. The updated TweetPosts are saved in the
	 * database after executing the analysis.
	 * 
	 * @param analysis AnaylseTyp to specify the analysis
	 */
	public void updateTweetPosts(AnalyseTyp analysis);
	
	/**
	 * Returns an array with 3 double values. Those values represents the
	 * percentage values for each mood of TweetPosts or YoutubeVideoTypes
	 * (positive, negative and neutral) specified by the StreamDescriptor. The
	 * streamDes argument must be available in the database.
	 * <p>
	 * result[0]: the percentage value of the positive mood <br>
	 * result[1]: the percentage value of the negative mood <br>
	 * result[2]: the percentage value of the neutral mood <br>
	 * 
	 * @param streamDes StreamDescriptor the database knows
	 * @return Array with 3 double values
	 */
	public double[] getPercentageSentiment(StreamDescriptor streamDes, FilterTyp filter);
	
	/**
	 * Returns a HashMap with GeoTags and Strings for a given StreamDescriptor.
	 * The streamDes argument must be available in the database.
	 * 
	 * @param streamDes StreamDescriptor the database knows
	 * @return HashMap of GeoTags and Strings associated with the given StreamDescriptor
	 */
	public HashMap<GeoTag,String> getAllGeoTags(StreamDescriptor streamDes);
	
	/**
	 * Returns a HashMap with GeoTags and Strings for a given StreamDescriptor
	 * and integer. The integer represents the mood for which the GeoTags are
	 * filtered. The streamDes argument must be available in the database
	 * <p>
	 * integer value "1" - returns the GeoTags for TweetPosts or YouTubeVideos with positive mood <br>
	 * integer value "-1" - returns the GeoTags for TweetPosts or YouTubeVideos with negative mood <br>
	 * integer value "0" - returns the GeoTags for TweetPosts or YouTubeVideos with neutral mood <br>
	 * Other values will be ignored.
	 * 
	 * @param streamDes StreamDescriptor the database knows
	 * @param sentiment Integer value to filter the GeoTags
	 * @return HashMap of GeoTags and Strings associated with the given StreamDescriptor and the given integer value
	 */
	public HashMap<GeoTag,String> getGeoTagsWithSentiment(StreamDescriptor streamDes, int sentiment);
	
	
	/**
     * Returns a TreeMap of Dates and Doubles, each describing the average
     * sentiment for an period. This map is sorted by date.
     * 
     * @param streamDes StreamDescriptor to describe the analyzed posts
     * @param startDate Date to be started with
     * @param endDate Date to declare the end of the timeframe
     * @param interval Integer to describe the length of one period in days
     * @return TreeMap of Dates and Doubles
     */
	public TreeMap<Date,Double> getAverageSentimentForPeriod(StreamDescriptor streamDes, Date startDate, Date endDate, int interval);
	
}
